home *** CD-ROM | disk | FTP | other *** search
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- #include "KT_PostProcess_Common.fx"
-
- //------------------------------------------------------------------------------------------------------
- //- Static parameters
- //------------------------------------------------------------------------------------------------------
-
- float4 GlowThreshold;
-
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- technique HorizontalBlurSample4
- <
- int Priority = 1;
- int TechniqueIndex = 0;
- int DeviceType = HWSHADER_ONLY;
- int LightingType = INTEGRATED_LIGHTING;
- string RenderingType = "Standard";
- >
- {
- pass pass1
- {
- Texture [0] = <SourceTexture1>;
- MinFilter[0] = LINEAR;
- MagFilter[0] = LINEAR;
- MipFilter[0] = NONE; //no mipmaps.
- AddressU [0] = CLAMP;
- AddressV [0] = CLAMP;
-
- Texture [1] = <SourceTexture1>;
- MinFilter[1] = LINEAR;
- MagFilter[1] = LINEAR;
- MipFilter[1] = NONE; //no mipmaps.
- AddressU [1] = CLAMP;
- AddressV [1] = CLAMP;
-
- Texture [2] = <SourceTexture1>;
- MinFilter[2] = LINEAR;
- MagFilter[2] = LINEAR;
- MipFilter[2] = NONE; //no mipmaps.
- AddressU [2] = CLAMP;
- AddressV [2] = CLAMP;
-
- Texture [3] = <SourceTexture1>;
- MinFilter[3] = LINEAR;
- MagFilter[3] = LINEAR;
- MipFilter[3] = NONE; //no mipmaps.
- AddressU [3] = CLAMP;
- AddressV [3] = CLAMP;
-
- AlphaBlendEnable = false;
- AlphaTestEnable = false;
- FogEnable = false;
-
- CullMode = NONE;
- ZEnable = false;
- ZWriteEnable = false;
-
- VertexShader = compile vs_1_1 VSNeighbourSamplingLine();
-
- PixelShader =
- asm
- {
- ps.1.1
-
- def c0, 0.0f,0.0f,0.0f,1.0f
- def c1, 0.15f,0.15f,0.15f,0.15f //blur weights of outer samples
- def c2, 0.35f,0.35f,0.35f,0.35f //blur weights of inner samples which may be resulting in colored blur if not equals
-
-
- tex t0
- tex t1
- tex t2
- tex t3
-
- mul r0.rgb, t0, c1 + mov r0.a, c0.a
- mad r0.rgb, t1, c2, r0
- mad r0.rgb, t2, c2, r0
- mad r0.rgb, t3, c1, r0
- };
- }
- }
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- technique VerticalBlurSample4
- <
- int Priority = 1;
- int TechniqueIndex = 1;
- int DeviceType = HWSHADER_ONLY;
- int LightingType = INTEGRATED_LIGHTING;
- string RenderingType = "Standard";
- >
- {
- pass pass1
- {
- Texture [0] = <SourceTexture1>;
- MinFilter[0] = LINEAR;
- MagFilter[0] = LINEAR;
- MipFilter[0] = NONE; //no mipmaps.
- AddressU [0] = CLAMP;
- AddressV [0] = CLAMP;
-
- Texture [1] = <SourceTexture1>;
- MinFilter[1] = LINEAR;
- MagFilter[1] = LINEAR;
- MipFilter[1] = NONE; //no mipmaps.
- AddressU [1] = CLAMP;
- AddressV [1] = CLAMP;
-
- Texture [2] = <SourceTexture1>;
- MinFilter[2] = LINEAR;
- MagFilter[2] = LINEAR;
- MipFilter[2] = NONE; //no mipmaps.
- AddressU [2] = CLAMP;
- AddressV [2] = CLAMP;
-
- Texture [3] = <SourceTexture1>;
- MinFilter[3] = LINEAR;
- MagFilter[3] = LINEAR;
- MipFilter[3] = NONE; //no mipmaps.
- AddressU [3] = CLAMP;
- AddressV [3] = CLAMP;
-
- AlphaBlendEnable = false;
- AlphaTestEnable = false;
- FogEnable = false;
-
- CullMode = NONE;
- ZEnable = false;
- ZWriteEnable = false;
-
- VertexShader = compile vs_1_1 VSNeighbourSamplingColumn();
-
- PixelShader =
- asm
- {
- ps.1.1
-
- def c0, 0.0f,0.0f,0.0f,1.0f
- def c1, 0.15f,0.15f,0.15f,0.15f //blur weights of outer samples
- def c2, 0.35f,0.35f,0.35f,0.35f //blur weights of inner samples which may be resulting in colored blur if not equals
-
- tex t0
- tex t1
- tex t2
- tex t3
-
- mul r0.rgb, t0, c1 + mov r0.a, c0.a
- mad r0.rgb, t1, c2, r0
- mad r0.rgb, t2, c2, r0
- mad r0.rgb, t3, c1, r0
- };
- }
- }
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- technique GlowMapBuild
- <
- int Priority = 1;
- int TechniqueIndex = 2;
- int DeviceType = HWSHADER_ONLY;
- int LightingType = INTEGRATED_LIGHTING;
- string RenderingType = "Standard";
- >
- {
- pass pass1
- {
- Texture [0] = <SourceTexture1>;
- MinFilter[0] = LINEAR;
- MagFilter[0] = LINEAR;
- MipFilter[0] = POINT;
- AddressU [0] = CLAMP;
- AddressV [0] = CLAMP;
-
- AlphaBlendEnable = false;
- AlphaTestEnable = false;
- FogEnable = false;
-
- CullMode = NONE;
- ZEnable = false;
- ZWriteEnable = false;
-
- VertexShader = compile vs_1_1 VSBase();
-
- PixelShaderConstant[0]=<GlowThreshold>;
-
- PixelShader =
- asm
- {
- ps.1.1
-
- def c1, 0.30f,0.59f,0.11f,0.0f //constantes de luminance. pour conversion de la scene en Noir & Blanc
- def c2, 0.0f,0.0f,0.0f,0.0f // zero, what we take for the glowmap where it is not supposed to glow
- def c3, 0.5f,0.5f,0.5f,0.5f // to bias the cnd level
-
- tex t0
-
- dp3 r0.rgba, t0, c1 //conversion en N&B, j ecris aussi et surtout dans l alpha.
-
- sub r0.a, r0, c0 // (rendu noir et blanc - seuil glow)
- add_sat r0.a, r0, c3 // le seuil du cnd est a 0.5 en hardware, pour couper ou on veut, on biaise notre seuil
- cnd r0, r0.a, t0, c2 // et masquage avec l alpha seuil, on construit la glow map en prenant le diffuse ou zero selon le seuil.
- };
- }
- }
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- technique LuminanceConversion
- <
- int Priority = 1;
- int TechniqueIndex = 3;
- int DeviceType = HWSHADER_ONLY;
- int LightingType = INTEGRATED_LIGHTING;
- string RenderingType = "Standard";
- >
- {
- pass pass1
- {
- Texture [0] = <SourceTexture1>;
- MinFilter[0] = LINEAR;
- MagFilter[0] = LINEAR;
- MipFilter[0] = POINT;
- AddressU [0] = CLAMP;
- AddressV [0] = CLAMP;
-
- AlphaBlendEnable = false;
- AlphaTestEnable = false;
- FogEnable = false;
-
- CullMode = NONE;
- ZEnable = false;
- ZWriteEnable = false;
-
- VertexShader = compile vs_1_1 VSBase();
-
- PixelShader =
- asm
- {
- ps.1.1
-
- def c1, 0.30f,0.59f,0.11f,0.0f //constantes de luminance. pour conversion de la scene en Noir & Blanc
-
- tex t0
-
- dp3 r0.rgba, t0, c1 //conversion en N&B, j ecris aussi et surtout dans l alpha.
- };
- }
- }
-
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-